home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 19 / CU Amiga Magazine's Super CD-ROM 19 (1998)(EMAP Images)(GB)[!][issue 1998-02].iso / CUCD / Readers / Gui4Cli / Tools / fastread / FastRead.gc next >
Text File  |  1997-12-02  |  3KB  |  152 lines

  1. G4C
  2.  
  3. winbig -1 -1 240 177 "FastRead.gc"
  4. wintype 11010001
  5. usetopaz
  6. varpath "viewtext.g"
  7.  
  8. xonreload
  9. guiopen fastread.gc
  10.  
  11. xonload
  12. extract fastread.gc guipath fre_path
  13. assign GCHELP: $fre_path
  14. delvar fre_path
  15. ttget gchelp:fastread.gc
  16. guiload gchelp:viewtext.g
  17. ifexists port AREXX
  18.     ;Nop
  19. elseifexists file sys:system/rexxmast
  20.     run 'sys:system/rexxmast >nil:'
  21. else
  22.     ezreq "Can't start ARexx" Okay ""
  23.     assign gchelp: remove
  24.     guiquit viewtext.g 
  25.     guiquit fastread.gc   
  26. endif
  27.  
  28. guide = $*FRGUIDE    ; change this 
  29.  
  30. if $guide = ''
  31.     reqfile -1 -1 200 -60 'Select A Document' load guide GUIS:Docs
  32.     if $guide = ''
  33.        assign GCHELP: remove
  34.        guiquit viewtext.g 
  35.        guiquit fastread.gc   
  36.        stop
  37.     endif
  38. endif
  39.  
  40. extract guide file list
  41. appvar list .idx
  42. joinfile gchelp:idx $list list
  43. ifexists file c:getnodes
  44. andifexists file c:writenode
  45.     run 'resident c:getnodes pure add'
  46.     run 'resident c:writenode pure add'
  47. elseifexists file guis:c/getnodes
  48. andifexists file guis:c/writenode
  49.     run 'resident guis:c/getnodes pure add'
  50.     run 'resident guis:c/writenode pure add'
  51. else
  52.     ezreq "Cannot Find Binaries." Okay ""
  53.     gosub fastread.gc exit
  54. endif
  55. ifexists file $list
  56.     ;nop
  57. else
  58.     cli 'getnodes $guide $list'
  59. endif
  60. lvuse fastread.gc 1
  61. lvchange $list
  62. guiopen fastread.gc
  63. extract guide file wtitle
  64. extract wtitle unquote wtitle
  65. setwintitle fastread.gc "$wtitle                      "
  66.  
  67.  
  68. xonkey #v
  69. xonkey #r
  70. if $$rawkey.code = 95
  71.     cli 'writenode guis:docs/helpsystem.txt 8655 1826'
  72.     guiopen viewtext.g
  73.     set translation off
  74.     lvuse viewtext.g 1
  75.     lvchange ram:guide.txt
  76. elseif $$rawkey.code = 78
  77.     lvuse fastread.gc 1
  78.     lvmove 1
  79. elseif $$rawkey.code = 79
  80.     lvuse fastread.gc 1
  81.     lvmove -1
  82. endif
  83.  
  84. xonclose
  85. gosub fastread.gc exit
  86.  
  87. xtextin 0 0 180 13   "" txt "" 80
  88. if $txt > ''
  89.     lvuse fastread.gc 1
  90.     lvsearch $txt ci first
  91. endif
  92. gosub fastread.gc search_update
  93.  
  94. xbutton 180 0 20 13 »
  95. if $txt > ''
  96.    lvuse fastread.gc 1
  97.    lvsearch $txt ci next
  98. endif
  99. gosub fastread.gc search_update
  100.  
  101. xbutton 200 0 40 13 Open
  102. reqfile -1 -1 200 -60 'Select A Guide:' load doc GUIS:Docs
  103. ifexists file $doc
  104.     guide = $doc
  105.     extract guide file list
  106.     appvar list .idx
  107.     joinfile gchelp:idx $list list
  108.     ifexists file $list
  109.         ;nop
  110.     else
  111.         cli 'getnodes $guide $list'
  112.     endif
  113.     lvuse fastread.gc 1
  114.     lvchange $list
  115.     extract guide file wtitle
  116.     extract wtitle unquote wtitle
  117.     setwintitle fastread.gc "$wtitle                      "
  118. endif
  119.  
  120. xlistview 0 13 240 170  '' topic '' 0 txt
  121. gadid 1
  122. gosub fastread.gc fetchtext
  123.  
  124. xroutine fetchtext
  125. cutvar topic cut word -2 offset
  126. extract topic upper topic
  127. extract topic unquote topic
  128. cli 'writenode $guide $offset'
  129. guiopen viewtext.g
  130. update viewtext.g 2 "Subject: $topic"
  131. set translation off
  132. lvuse viewtext.g 1
  133. lvchange ram:guide.txt
  134.  
  135. xroutine search_update
  136. if $$lv.line > ''
  137.    update fastread.gc 1 $$lv.line
  138. else
  139.    lvgo #0
  140.    update fastread.gc 1 0
  141. endif
  142.  
  143. xroutine exit
  144. assign GCHELP: remove
  145. run 'resident getnodes remove'
  146. run 'resident writenode remove'
  147. ifexists file ram:guide.txt
  148.     delete ram:guide.txt
  149. endif
  150. guiquit viewtext.g 
  151. guiquit fastread.gc   
  152.